// MySliderCtrl.cpp : implementation file
//

#include "stdafx.h"
#include "MultiMedia.h"
#include "MySliderCtrl.h"


// CMySliderCtrl

IMPLEMENT_DYNAMIC(CMySliderCtrl, CSliderCtrl)

CMySliderCtrl::CMySliderCtrl()
{

}

CMySliderCtrl::~CMySliderCtrl()
{
}


BEGIN_MESSAGE_MAP(CMySliderCtrl, CSliderCtrl)
	ON_WM_LBUTTONDOWN()
END_MESSAGE_MAP()



// CMySliderCtrl message handlers
void CMySliderCtrl::OnLButtonDown(UINT nFlags, CPoint point)
{
	// TODO: Add your message handler code here and/or call default

	CSliderCtrl::OnLButtonDown(nFlags, point);
    CRect   rectClient,rectChannel; 
    GetClientRect(rectClient); 
    GetChannelRect(rectChannel); 
    int   nPos = (GetRangeMax()-GetRangeMin())*(point.x - rectClient.left - rectChannel.left)/(rectChannel.right - rectChannel.left); 
    SetPos(nPos);
}

